@extends('admins.layouts.home')

@section('sidebar')
    @parent

    @if(! empty($moduleList))
        <ul class="list-group">
            <li class="list-group-item active"> 模块列表 Module</li>
            @foreach ($moduleList as $rows)
              <li class="list-group-item">
                  <a href="/admins/categories/module-{{ $rows['module_name_en'] }}">
                      <strong> {{ $rows['module_name'] }} ({{ $rows['module_name_en'] }}) </strong>
              </li>
              
            @endforeach
        </ul>
    @endif

@endsection

@section('content')

  <ol class="breadcrumb">
    <li><a href="/">首页</a></li>
    <li><a href="/" class="active">分类列表</a></li>
  </ol>

  <div class="panel panel-default">
      <div class="panel-heading">
          <strong> 分类管理 </strong>
          <a href="/admins/categories/add?module={{$module}}" class="btn btn-xs btn-success">新增分类</a>
      </div>
      <div class="panel-body">
       
        
            <table class="table table-striped">
              <tr>
                <th>ID</th>
                <th>模块</th>
                <th>分类名称</th>
                <th>最后更新</th>
                <th>操作</th>
              </tr>
              @foreach ($categoryList as $rows)

              <tr>
                <th scope="row">{{ $rows['category_id'] }}</th>
                <th scope="row">{{ $rows['module'] }}</th>
                <td> 
                  <a href="/admins/posts?category={{ $rows['category_name_en'] }}"> {{ $rows['category_name'] }} </a>
                  
                  ( <span>{{ $rows['category_name_en'] }} </span> )

                </td>
                <td>{{ $rows['updated_at'] ?: '--' }}</td>
                <td>
                <a href="/admins/categories/edit/{{ $rows['category_id'] }}">Edit</a>
                </td>
              </tr>

              @endforeach
          </table>

      </div>
  </div>





@endsection